package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_alipay_callback", schema = "", catalog = "onedollar")
public class TAlipayCallbackEntity {
    private int id;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private String tradeNo;

    @Basic
    @Column(name = "trade_no", nullable = true, insertable = true, updatable = true, length = 64)
    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    private String tradeStatus;

    @Basic
    @Column(name = "trade_status", nullable = true, insertable = true, updatable = true, length = 20)
    public String getTradeStatus() {
        return tradeStatus;
    }

    public void setTradeStatus(String tradeStatus) {
        this.tradeStatus = tradeStatus;
    }

    private String outTradeNo;

    @Basic
    @Column(name = "out_trade_no", nullable = true, insertable = true, updatable = true, length = 64)
    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    private BigDecimal totalFee;

    @Basic
    @Column(name = "total_fee", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(BigDecimal totalFee) {
        this.totalFee = totalFee;
    }

    private String body;

    @Basic
    @Column(name = "body", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    private String memo;

    @Basic
    @Column(name = "memo", nullable = true, insertable = true, updatable = true, length = 250)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    private Timestamp callbackTime;

    @Basic
    @Column(name = "callback_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getCallbackTime() {
        return callbackTime;
    }

    public void setCallbackTime(Timestamp callbackTime) {
        this.callbackTime = callbackTime;
    }

    private Timestamp notifyTime;

    @Basic
    @Column(name = "notify_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getNotifyTime() {
        return notifyTime;
    }

    public void setNotifyTime(Timestamp notifyTime) {
        this.notifyTime = notifyTime;
    }

    private String subject;

    @Basic
    @Column(name = "subject", nullable = true, insertable = true, updatable = true, length = 128)
    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    private String paymentType;

    @Basic
    @Column(name = "payment_type", nullable = true, insertable = true, updatable = true, length = 4)
    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    private String notifyId;

    @Basic
    @Column(name = "notify_id", nullable = true, insertable = true, updatable = true, length = 64)
    public String getNotifyId() {
        return notifyId;
    }

    public void setNotifyId(String notifyId) {
        this.notifyId = notifyId;
    }

    private String buyerId;

    @Basic
    @Column(name = "buyer_id", nullable = true, insertable = true, updatable = true, length = 30)
    public String getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(String buyerId) {
        this.buyerId = buyerId;
    }

    private String buyerEmail;

    @Basic
    @Column(name = "buyer_email", nullable = true, insertable = true, updatable = true, length = 100)
    public String getBuyerEmail() {
        return buyerEmail;
    }

    public void setBuyerEmail(String buyerEmail) {
        this.buyerEmail = buyerEmail;
    }

    private Integer quantity;

    @Basic
    @Column(name = "quantity", nullable = true, insertable = true, updatable = true)
    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    private BigDecimal price;

    @Basic
    @Column(name = "price", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    private Timestamp gmtCreate;

    @Basic
    @Column(name = "gmt_create", nullable = true, insertable = true, updatable = true)
    public Timestamp getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Timestamp gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    private Timestamp gmtPayment;

    @Basic
    @Column(name = "gmt_payment", nullable = true, insertable = true, updatable = true)
    public Timestamp getGmtPayment() {
        return gmtPayment;
    }

    public void setGmtPayment(Timestamp gmtPayment) {
        this.gmtPayment = gmtPayment;
    }

    private String isTotalFeeAdjust;

    @Basic
    @Column(name = "is_total_fee_adjust", nullable = true, insertable = true, updatable = true, length = 1)
    public String getIsTotalFeeAdjust() {
        return isTotalFeeAdjust;
    }

    public void setIsTotalFeeAdjust(String isTotalFeeAdjust) {
        this.isTotalFeeAdjust = isTotalFeeAdjust;
    }

    private String useCoupon;

    @Basic
    @Column(name = "use_coupon", nullable = true, insertable = true, updatable = true, length = 1)
    public String getUseCoupon() {
        return useCoupon;
    }

    public void setUseCoupon(String useCoupon) {
        this.useCoupon = useCoupon;
    }

    private String discount;

    @Basic
    @Column(name = "discount", nullable = true, insertable = true, updatable = true, length = 20)
    public String getDiscount() {
        return discount;
    }

    public void setDiscount(String discount) {
        this.discount = discount;
    }

    private String refundStatus;

    @Basic
    @Column(name = "refund_status", nullable = true, insertable = true, updatable = true, length = 25)
    public String getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(String refundStatus) {
        this.refundStatus = refundStatus;
    }

    private Timestamp gmtRefund;

    @Basic
    @Column(name = "gmt_refund", nullable = true, insertable = true, updatable = true)
    public Timestamp getGmtRefund() {
        return gmtRefund;
    }

    public void setGmtRefund(Timestamp gmtRefund) {
        this.gmtRefund = gmtRefund;
    }

    private Timestamp payTime;

    @Basic
    @Column(name = "pay_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getPayTime() {
        return payTime;
    }

    public void setPayTime(Timestamp payTime) {
        this.payTime = payTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TAlipayCallbackEntity that = (TAlipayCallbackEntity) o;

        if (id != that.id) return false;
        if (tradeNo != null ? !tradeNo.equals(that.tradeNo) : that.tradeNo != null) return false;
        if (tradeStatus != null ? !tradeStatus.equals(that.tradeStatus) : that.tradeStatus != null) return false;
        if (outTradeNo != null ? !outTradeNo.equals(that.outTradeNo) : that.outTradeNo != null) return false;
        if (totalFee != null ? !totalFee.equals(that.totalFee) : that.totalFee != null) return false;
        if (body != null ? !body.equals(that.body) : that.body != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (callbackTime != null ? !callbackTime.equals(that.callbackTime) : that.callbackTime != null) return false;
        if (notifyTime != null ? !notifyTime.equals(that.notifyTime) : that.notifyTime != null) return false;
        if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false;
        if (paymentType != null ? !paymentType.equals(that.paymentType) : that.paymentType != null) return false;
        if (notifyId != null ? !notifyId.equals(that.notifyId) : that.notifyId != null) return false;
        if (buyerId != null ? !buyerId.equals(that.buyerId) : that.buyerId != null) return false;
        if (buyerEmail != null ? !buyerEmail.equals(that.buyerEmail) : that.buyerEmail != null) return false;
        if (quantity != null ? !quantity.equals(that.quantity) : that.quantity != null) return false;
        if (price != null ? !price.equals(that.price) : that.price != null) return false;
        if (gmtCreate != null ? !gmtCreate.equals(that.gmtCreate) : that.gmtCreate != null) return false;
        if (gmtPayment != null ? !gmtPayment.equals(that.gmtPayment) : that.gmtPayment != null) return false;
        if (isTotalFeeAdjust != null ? !isTotalFeeAdjust.equals(that.isTotalFeeAdjust) : that.isTotalFeeAdjust != null)
            return false;
        if (useCoupon != null ? !useCoupon.equals(that.useCoupon) : that.useCoupon != null) return false;
        if (discount != null ? !discount.equals(that.discount) : that.discount != null) return false;
        if (refundStatus != null ? !refundStatus.equals(that.refundStatus) : that.refundStatus != null) return false;
        if (gmtRefund != null ? !gmtRefund.equals(that.gmtRefund) : that.gmtRefund != null) return false;
        if (payTime != null ? !payTime.equals(that.payTime) : that.payTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (tradeNo != null ? tradeNo.hashCode() : 0);
        result = 31 * result + (tradeStatus != null ? tradeStatus.hashCode() : 0);
        result = 31 * result + (outTradeNo != null ? outTradeNo.hashCode() : 0);
        result = 31 * result + (totalFee != null ? totalFee.hashCode() : 0);
        result = 31 * result + (body != null ? body.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (callbackTime != null ? callbackTime.hashCode() : 0);
        result = 31 * result + (notifyTime != null ? notifyTime.hashCode() : 0);
        result = 31 * result + (subject != null ? subject.hashCode() : 0);
        result = 31 * result + (paymentType != null ? paymentType.hashCode() : 0);
        result = 31 * result + (notifyId != null ? notifyId.hashCode() : 0);
        result = 31 * result + (buyerId != null ? buyerId.hashCode() : 0);
        result = 31 * result + (buyerEmail != null ? buyerEmail.hashCode() : 0);
        result = 31 * result + (quantity != null ? quantity.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + (gmtCreate != null ? gmtCreate.hashCode() : 0);
        result = 31 * result + (gmtPayment != null ? gmtPayment.hashCode() : 0);
        result = 31 * result + (isTotalFeeAdjust != null ? isTotalFeeAdjust.hashCode() : 0);
        result = 31 * result + (useCoupon != null ? useCoupon.hashCode() : 0);
        result = 31 * result + (discount != null ? discount.hashCode() : 0);
        result = 31 * result + (refundStatus != null ? refundStatus.hashCode() : 0);
        result = 31 * result + (gmtRefund != null ? gmtRefund.hashCode() : 0);
        result = 31 * result + (payTime != null ? payTime.hashCode() : 0);
        return result;
    }
}
